<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;

class BaseConfig extends Model
{
    use HasFactory;
    protected $guarded=[];
    //home_banner
    public function getHomeBannerAttribute($value){
        return json_decode($value,true);
    }
    public function setHomeBannerAttribute($value)
    {
        $this->attributes['home_banner'] = json_encode($value);
    }
    //district
    public function getDistrictAttribute($value){
        return json_decode($value,true);
    }
    public function setDistrictAttribute($value)
    {
        $this->attributes['district'] = json_encode($value);
    }
    //car_series
    public function getCarSeriesAttribute($value){
        return json_decode($value,true);
    }
    public function setCarSeriesAttribute($value)
    {
        $this->attributes['car_series'] = json_encode($value);
    }

}
